package algo_annotations.ihm.couche;

import algo_annotations.data.Data_a;
import algo_annotations.data.annotations.Anno;
import commons.data.I_Data.DataType;
import commons.drawing.I_Drawable;
import commons.drawing.couche.CoucheBasic;
import commons.utils.primitive_geom.Rect_d;
import java.util.ArrayList;

// Couches des BoundingBox des annotations
public class CoucheAnno_BB extends CoucheBasic {

	public CoucheAnno_BB(Data_a data) {
		super("Annotation bb", null, data);
	}


	@Override
	public ArrayList<I_Drawable> getDrawables(Rect_d rectVisu) {
		ArrayList<Anno> vAnno = data.getData(DataType.ANNO_A, rectVisu);

		if (vAnno ==null)
			return new ArrayList<I_Drawable>(0);

		ArrayList<I_Drawable> vAnnoBB = new ArrayList<I_Drawable>(vAnno.size());
		for (Anno anno : vAnno) {
			if (!anno.site.hasAnno()) continue; // site sans anno
			vAnnoBB.add(new DrawableAnnoBB(anno));
		}

		return vAnnoBB;
	}

}
